<template>
  <div>
    <van-tabbar v-model="active" active-color="#f00" inactive-color="#646566">
      <van-tabbar-item to="/" icon="wap-home-o">首页</van-tabbar-item>
      <van-tabbar-item to="/category" icon="point-gift-o">分类</van-tabbar-item>
      <van-tabbar-item v-if="$store.getters.getBadgeCount > 0" to="/shopcart" icon="shopping-cart-o" :badge="$store.getters.getBadgeCount">购物车</van-tabbar-item>
      <van-tabbar-item v-else to="/shopcart" icon="shopping-cart-o">购物车</van-tabbar-item>
      <van-tabbar-item to="/user" icon="user-o">我的</van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script>
export default {
  data() {
    return {
      active: 0,
    };
  },
};
</script>
<style lang="scss">
</style>